package com.banhujiu.spider.yaodaojiao;

import java.io.IOException;
import java.net.URL;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

/**
 * @author banhujiu
 * @date 2018/8/5 0005 15:27
 */
public class Bootstrap {
	public static void main(String[] args) throws IOException {
		String url = "http://video.yaodaojiao.com/jinguang/msfj/";
		Document parse = Jsoup.parse(new URL(url).openStream(), "utf-8", url);
		Elements elements = parse.select("div.c_box a");
		for (Element element : elements) {
			String articleUrl = element.attr("href");
			Document article = Jsoup.parse(new URL(articleUrl).openStream(), "utf-8", url);
			Elements iframe = article.select("iframe");
			System.out.println(iframe.first().attr("src"));
		}
	}
}
